package cn.com.lib;

import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Window;

/** @author maizi
 * LibBaseActivity.java
 * 2015年5月19日
 * 自定义Activity基类
 */
public abstract class LibBaseActivity extends Activity {
	
	protected Context context;
	protected Activity activity;
	/**屏幕高度
	 */
	protected int height;
	/**屏幕宽度
	 */
	protected int width;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		context = this;
		activity = this;
		setUpWindow();
		initSize();
	}
	/**设置全屏
	 */
	private void setUpWindow() {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // 禁止横屏
	}
	/**获取屏幕尺寸
	 */
	private void initSize() {
		DisplayMetrics mDisplayMetrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);
		width = mDisplayMetrics.widthPixels;
		height = mDisplayMetrics.heightPixels;
	}

	@Override
	protected void onStart() {
		super.onStart();
	}

	@Override
	protected void onRestart() {
		super.onRestart();
	}

	@Override
	protected void onResume() {
		super.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onStop() {
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}
	
	

}
